var pcmb = [{
    PCMBBM: "3700000010000001",
    PCMBMC: "通用模板",
    PCFLBM: "001",
    PCMBLX: "1",
    PCXFL: [
        {
            PCXFLBM: "37000000100000010001",
            PCXFLMC: "事实认定",
            PCXFLFBM: "",
            XH: "1",
            PCJLBM: "",
            SM: "",
            PCXZFL: [
                {
                    PCXFLBM: "37000000100000010006",
                    PCXFLMC: "无问题",
                    PCXFLFBM: "37000000100000010001",
                    XH: "6",
                    PCJLBM: "",
                    SM: "",
                    PCX: [{
                        PCXBM: "37000000100000010001",
                        PCXMC: "其他",
                        PCXFLBM: "37000000100000010006",
                        XH: "",
                        PCJLBM: "",
                        PCXLX: "2"
                    }]

                },
                {
                    PCXFLBM: "37000000100000010007",
                    PCXFLMC: "司法瑕疵",
                    PCXFLFBM: "37000000100000010001",
                    XH: "7",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010001",
                            PCXMC: "犯罪事实有遗漏；",
                            PCXFLBM: "37000000100000010007",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010002",
                            PCXMC: "犯罪情节有遗漏；",
                            PCXFLBM: "37000000100000010007",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010003",
                            PCXMC: "犯罪事实表述不准确；",
                            PCXFLBM: "37000000100000010007",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010004",
                            PCXMC: "犯罪情节表述不准确；",
                            PCXFLBM: "37000000100000010007",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010005",
                            PCXMC: "其他事实认定遗漏或不准确。",
                            PCXFLBM: "37000000100000010007",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010008",
                    PCXFLMC: "一般司法错误",
                    PCXFLFBM: "37000000100000010001",
                    XH: "8",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010006",
                            PCXMC: "案件主要事实认定错误，影响结论正确性；",
                            PCXFLBM: "37000000100000010008",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010007",
                            PCXMC: "遗漏犯罪事实或者犯罪嫌疑人，审查逮捕案件除外；",
                            PCXFLBM: "37000000100000010008",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010008",
                            PCXMC: "法定量刑事实认定错误；",
                            PCXFLBM: "37000000100000010008",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010009",
                            PCXMC: "其他事实认定错误。",
                            PCXFLBM: "37000000100000010008",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010009",
                    PCXFLMC: "严重司法错误",
                    PCXFLFBM: "37000000100000010001",
                    XH: "9",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010010",
                            PCXMC: "事实认定严重错误。",
                            PCXFLBM: "37000000100000010009",
                            XH: "",
                            PCJLBM: "因故意或重大过失，遗漏、错误认定重要案件事实或情节，导致案件错误逮捕或不捕、错误不起诉、无罪判决、撤回起诉、国家赔偿等严重后果的"
                        }
                    ]

                }
            ]
        },
        {
            PCXFLBM: "37000000100000010002",
            PCXFLMC: "证据采信",
            PCXFLFBM: "",
            XH: "2",
            PCJLBM: "",
            SM: "",
            PCXZFL: [
                {
                    PCXFLBM: "37000000100000010010",
                    PCXFLMC: "无问题",
                    PCXFLFBM: "37000000100000010002",
                    XH: "10",
                    PCJLBM: "",
                    SM: "",
                    PCX: []

                },
                {
                    PCXFLBM: "37000000100000010011",
                    PCXFLMC: "司法瑕疵",
                    PCXFLFBM: "37000000100000010002",
                    XH: "11",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010011",
                            PCXMC: "证据收集调取不符合规定；",
                            PCXFLBM: "37000000100000010011",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010012",
                            PCXMC: "证据保存不符合规定；",
                            PCXFLBM: "37000000100000010011",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010013",
                            PCXMC: "证据移送不符合规定；",
                            PCXFLBM: "37000000100000010011",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010014",
                            PCXMC: "证据使用不符合规定；",
                            PCXFLBM: "37000000100000010011",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010015",
                            PCXMC: "其他违反证据规定的情形。",
                            PCXFLBM: "37000000100000010011",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010012",
                    PCXFLMC: "一般司法错误",
                    PCXFLFBM: "37000000100000010002",
                    XH: "12",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010016",
                            PCXMC: "非法证据未排除；",
                            PCXFLBM: "37000000100000010012",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010017",
                            PCXMC: "瑕疵证据未补正；",
                            PCXFLBM: "37000000100000010012",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010018",
                            PCXMC: "据以定罪的证据存在明显矛盾，未排除合理怀疑的。",
                            PCXFLBM: "37000000100000010012",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010013",
                    PCXFLMC: "严重司法错误",
                    PCXFLFBM: "37000000100000010002",
                    XH: "13",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010019",
                            PCXMC: "存在刑讯逼供暴力取证等情形；",
                            PCXFLBM: "37000000100000010013",
                            XH: "",
                            PCJLBM: "证据收集过程中存在刑讯逼供、暴力取证或以其他非法方式获取证据的违法行为，造成严重后果的。"
                        },
                        {
                            PCXBM: "37000000100000010020",
                            PCXMC: "未能排除非法证据。",
                            PCXFLBM: "37000000100000010013",
                            XH: "",
                            PCJLBM: "未能排除非法证据，导致案件错误逮捕或不捕、错误不起诉、无罪判决、撤回起诉、国家赔偿等严重后果的未能排除非法证据，导致案件错误逮捕或不捕、错误不起诉、无罪判决、撤回起诉、国家赔偿等严重后果的"
                        }
                    ]

                }
            ]
        },
        {
            PCXFLBM: "37000000100000010003",
            PCXFLMC: "法律适用",
            PCXFLFBM: "",
            XH: "3",
            PCJLBM: "",
            SM: "",
            PCXZFL: [
                {
                    PCXFLBM: "37000000100000010014",
                    PCXFLMC: "无问题",
                    PCXFLFBM: "37000000100000010003",
                    XH: "14",
                    PCJLBM: "",
                    SM: "",
                    PCX: []

                },
                {
                    PCXFLBM: "37000000100000010015",
                    PCXFLMC: "司法瑕疵",
                    PCXFLFBM: "37000000100000010003",
                    XH: "15",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010021",
                            PCXMC: "遗漏适用法律条款；",
                            PCXFLBM: "37000000100000010015",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010022",
                            PCXMC: "错误适用法律条款；",
                            PCXFLBM: "37000000100000010015",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010023",
                            PCXMC: "引用法律条款不完整；",
                            PCXFLBM: "37000000100000010015",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010024",
                            PCXMC: "引用法律条款不规范；",
                            PCXFLBM: "37000000100000010015",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010025",
                            PCXMC: "选择性罪名未根据实际情况明确到具体罪名；",
                            PCXFLBM: "37000000100000010015",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010026",
                            PCXMC: "其他适用法律不准确不完整不规范的。",
                            PCXFLBM: "37000000100000010015",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010016",
                    PCXFLMC: "一般司法错误",
                    PCXFLFBM: "37000000100000010003",
                    XH: "16",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010027",
                            PCXMC: "适用法律错误造成此罪与彼罪认定不当；",
                            PCXFLBM: "37000000100000010016",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010028",
                            PCXMC: "适用法律错误导致跨幅度量刑；",
                            PCXFLBM: "37000000100000010016",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010029",
                            PCXMC: "遗漏或错误认定法定情节，影响定罪量刑的。",
                            PCXFLBM: "37000000100000010016",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010017",
                    PCXFLMC: "严重司法错误",
                    PCXFLFBM: "37000000100000010003",
                    XH: "17",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010030",
                            PCXMC: "适用法律条款严重错误；",
                            PCXFLBM: "37000000100000010017",
                            XH: "",
                            PCJLBM: "错误适用法律条款，导致无罪判决、撤回起诉或国家赔偿的"
                        },
                        {
                            PCXBM: "37000000100000010031",
                            PCXMC: "应当适用刑诉法第十五条而未适用；",
                            PCXFLBM: "37000000100000010017",
                            XH: "",
                            PCJLBM: "应当适用刑诉法第十五条而未适用，导致被错误逮捕或错误起诉的应当适用刑诉法第十五条而未适用，导致被错误逮捕或错误起诉的"
                        },
                        {
                            PCXBM: "37000000100000010032",
                            PCXMC: "其他适用法律错误，造成严重后果的。",
                            PCXFLBM: "37000000100000010017",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                }
            ]
        },
        {
            PCXFLBM: "37000000100000010004",
            PCXFLMC: "办案程序",
            PCXFLFBM: "",
            XH: "4",
            PCJLBM: "",
            SM: "",
            PCXZFL: [
                {
                    PCXFLBM: "37000000100000010018",
                    PCXFLMC: "无问题",
                    PCXFLFBM: "37000000100000010004",
                    XH: "18",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {}
                    ]

                },
                {
                    PCXFLBM: "37000000100000010019",
                    PCXFLMC: "司法瑕疵",
                    PCXFLFBM: "37000000100000010004",
                    XH: "19",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010033",
                            PCXMC: "违反管辖规定受理、办理案件的；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010034",
                            PCXMC: "违反回避规定，尚未造成严重后果的；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010035",
                            PCXMC: "未按规定保障诉讼当事人诉讼权利的；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010036",
                            PCXMC: "未将相关文书在法定期限内送达告知诉讼当事人的；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010037",
                            PCXMC: "讯问、询问违反规定；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010038",
                            PCXMC: "未履行宣告手续；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010039",
                            PCXMC: "应备案而未报送（移送）备案的；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010040",
                            PCXMC: "违反有关请示、上报、批复、送达、告知等时效规定的；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010041",
                            PCXMC: "填写法院刑事判决裁定审查表与实际情况不符的；",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010042",
                            PCXMC: "其他违反法律程序及检察工作内部程序的情形。",
                            PCXFLBM: "37000000100000010019",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010020",
                    PCXFLMC: "一般司法错误",
                    PCXFLFBM: "37000000100000010004",
                    XH: "20",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010043",
                            PCXMC: "违反回避规定，造成严重影响的；",
                            PCXFLBM: "37000000100000010020",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010044",
                            PCXMC: "办案中形成的重要的处理、决定未及时送达、告知，造成严重后果的；",
                            PCXFLBM: "37000000100000010020",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010045",
                            PCXMC: "超过法定办案期限，但未导致犯罪嫌疑人超期羁押的。",
                            PCXFLBM: "37000000100000010020",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010021",
                    PCXFLMC: "严重司法错误",
                    PCXFLFBM: "37000000100000010004",
                    XH: "21",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010046",
                            PCXMC: "错误羁押犯罪嫌疑人；",
                            PCXFLBM: "37000000100000010021",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010047",
                            PCXMC: "超期羁押犯罪嫌疑人；",
                            PCXFLBM: "37000000100000010021",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010048",
                            PCXMC: "超期办案，严重影响当事人诉讼权利的；",
                            PCXFLBM: "37000000100000010021",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010049",
                            PCXMC: "错误处理涉案财物的。",
                            PCXFLBM: "37000000100000010021",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                }
            ]
        },
        {
            PCXFLBM: "37000000100000010005",
            PCXFLMC: "法律文书",
            PCXFLFBM: "",
            XH: "5",
            PCJLBM: "",
            SM: "",
            PCXZFL: [
                {
                    PCXFLBM: "37000000100000010022",
                    PCXFLMC: "无问题",
                    PCXFLFBM: "37000000100000010005",
                    XH: "22",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {}
                    ]

                },
                {
                    PCXFLBM: "37000000100000010023",
                    PCXFLMC: "司法瑕疵",
                    PCXFLFBM: "37000000100000010005",
                    XH: "23",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010050",
                            PCXMC: "法律文书的名称、类型、文号错误的；",
                            PCXFLBM: "37000000100000010023",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010051",
                            PCXMC: "法律文书格式要素不齐全的；",
                            PCXFLBM: "37000000100000010023",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010052",
                            PCXMC: "法律文书中记载的身份状况、前科劣迹、作案时间、犯罪数额、案由等内容与在案证据不一致的；",
                            PCXFLBM: "37000000100000010023",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010053",
                            PCXMC: "对外法律文书文字、语法、符号等存在三处以上不规范、遗漏、错误；",
                            PCXFLBM: "37000000100000010023",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010054",
                            PCXMC: "未依照法律规定签名、盖章、捺手印、注明时间等情形的；",
                            PCXFLBM: "37000000100000010023",
                            XH: "",
                            PCJLBM: ""
                        },
                        {
                            PCXBM: "37000000100000010055",
                            PCXMC: "其他法律文书制作不规范、不准确、不严谨的情形。",
                            PCXFLBM: "37000000100000010023",
                            XH: "",
                            PCJLBM: ""
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010024",
                    PCXFLMC: "一般司法错误",
                    PCXFLFBM: "37000000100000010005",
                    XH: "24",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010056",
                            PCXMC: "对外法律文书内容错误；",
                            PCXFLBM: "37000000100000010024",
                            XH: "",
                            PCJLBM: "对外法律文书的诉讼当事人姓名、涉嫌罪名等重要内容存在错误，严重影响法律文书质量，或引发相关当事人严重不满的"
                        },
                        {
                            PCXBM: "37000000100000010057",
                            PCXMC: "对外法律文书类型错误；",
                            PCXFLBM: "37000000100000010024",
                            XH: "",
                            PCJLBM: "对外法律文书类型使用发生严重错误，造成不良后果的"
                        }
                    ]

                },
                {
                    PCXFLBM: "37000000100000010025",
                    PCXFLMC: "严重司法错误",
                    PCXFLFBM: "37000000100000010005",
                    XH: "25",
                    PCJLBM: "",
                    SM: "",
                    PCX: [
                        {
                            PCXBM: "37000000100000010058",
                            PCXMC: "对外法律文书有严重质量问题，造成严重后果或影响的。",
                            PCXFLBM: "37000000100000010025",
                            XH: "",
                            PCJLBM: ""
                        }, {
                            PCXBM: "37000000100000010059",
                            PCXMC: "其他",
                            PCXFLBM: "37000000100000010025",
                            XH: "",
                            PCJLBM: "",
                            PCXLX: "2"
                        }
                    ]

                }
            ]
        }
    ]
}];

forTEST(pcmb);
function forTEST(data) {
    data.forEach(function (d) {//模板循环
        var muban_dom = $("<div class='muban'></div>");
        for (var key in d) {
            if (Object.prototype.toString.call(d[key]) != '[object Array]') {
                muban_dom.attr(key, d[key]);
            }
        }
        d.PCXFL.forEach(function (pcfl) {//评查分类循环
            var pcfl_dom = $("<div class=\"pcbl_pcxx_center_left_menu\"><div class=\"center_left_menu_top\"><h5>" + pcfl.PCXFLMC + "</h5></div></div>");

            for (var k1 in pcfl) {
                if (Object.prototype.toString.call(pcfl[k1]) != '[object Array]') {
                    pcfl_dom.attr(k1, pcfl[k1]);
                }
            }
            pcfl.PCXZFL.forEach(function (pczl, index) {//评查子分类循环
                var pczl_dom = $("<div class=\"radio radio_wwt\"><div class=\"redio_click\"></div>" + pczl.PCXFLMC + "</div>");
                var pczl_box = $("<div class=\" pczl_box\" style='display:none'></div>");
                if (index == 0) {
                    pczl_dom.find('.redio_click').addClass('redio_click_no');
                }
                for (var kk in pczl) {
                    if (Object.prototype.toString.call(pczl[kk]) != '[object Array]') {
                        pczl_box.attr(kk, pczl[kk]);
                    }
                }
                pczl.PCX.forEach(function (item) { //评查项循环
                    if (!item.PCXMC) {
                        return;
                    }
                    var dom;
                    if (item.PCXLX && item.PCXLX == 2) {
                        dom = $("<div class=\"select_option\"><input type='text' placeholder='其他' ></div>");
                    } else {
                        dom = $("<div class=\"select_option\"><label><input type=\"checkbox\">" +
                            item.PCXMC + "</label></div>");
                        if (item.PCJLBM == 1) {
                            dom.find("input[type='checkbox']").prop("checked", true);
                        }
                    }


                    //使用name属性关联到子分类
                    dom.attr("name", pczl.PCXFLBM);
                    dom.find('input').val(item.PCXMC);
                    dom.find('input').attr('number', item.PCXBM);

                    for (var ks in item) {
                        if (Object.prototype.toString.call(item[ks]) != '[object Array]') {
                            dom.attr(ks, item[ks]);
                        }
                    }

                    if (item.PCJLBM == 1 && item.PCJLBM != '') {
                        dom.find('iniput').prop('checked', true);
                    }
                    //添加到子分类框里
                    pczl_box.append(dom);
                });


                pczl_dom.attr("box-no", pczl.PCXFLBM);
                pczl_box.attr("box-no", pczl.PCXFLBM);
                pcfl_dom.find(".center_left_menu_top").append(pczl_dom);
                // console.log(pcfl_dom.find(".center_left_menu_top"
                pcfl_dom.append(pczl_box);
            });
            pcfl_dom.find(".center_left_menu_top").append("<div class=\"switch\"></div>");
            // console.log(pcfl_dom);
            // alert(JSON.stringify(pcfl_dom.html()));

            muban_dom.append(pcfl_dom);
        });
        $("#ZLPCNR_CONTAINTER").append(muban_dom);
    });


    // $(".switch").off("click")
    $(".switch").unbind("click");
    $(".radio").unbind('click');
    addClickListener();

}

$('.mrm_submit').click(function () {
    var d = initPostData();
    console.log(d);
});

function addClickListener() {
    console.log($(".switch"));
    $(".radio").click(function () {
        $(this).children(".redio_click").addClass("redio_click_no");
        $(this).siblings().children(".redio_click").removeClass("redio_click_no");
        toggleShow();
    });

    $(".switch").click(function () {
        $(this).toggleClass('switch_click');
        toggleShow();
    });
}

//判断每个选项面板是否显示
function toggleShow() {
    // alert("do toggleShow");
    var sw = $(".switch");
    // console.log(sw);
    for (var j = 0; j < sw.length; j++) {
        var doms = sw.eq(j).siblings(".radio");
        console.log(doms);
        for (var i = 0; i < doms.length; i++) {
            var no = doms.eq(i).attr('box-no');
            console.log(no);
            var target = $(".pczl_box[box-no=" + no + "]");
            if (doms.eq(i).find('.redio_click').hasClass('redio_click_no') && sw.eq(j).hasClass('switch_click')) {
                target.show();
            } else {
                target.hide();
            }
        }
    }
}

//遍历质量评查内容，生成提交数据
function initPostData() {
    var d_arr = [];
    var muban = $('.muban');
    for (var i = 0; i < muban.length; i++) {
        var attr = muban[i].attributes;
        // var attr = muban[i];
        console.log(attr);
        var aob = {};
        for (var at in attr) {
            aob[attr[at].name] = attr[at].value;
        }
        aob.PCXFL = [];

        var pcfls = muban.eq(i).find('.pcbl_pcxx_center_left_menu');
        for (var j = 0; j < pcfls.length; j++) {
            var pcfl_obj_attrs = pcfls[j].attributes;
            var pcfl = {};
            pcfl.PCX = [];
            for (var pcfl_attr_k in pcfl_obj_attrs) {
                pcfl[pcfl_obj_attrs[pcfl_attr_k].name] = pcfl_obj_attrs[pcfl_attr_k].value;
            }
            var pczls = pcfls.eq(j).find('.pczl_box');
            for (var m = 0; m < pczls.length; m++) {
                var pczl_attrs = pczls[m].attributes;
                var pczl_att = {};
                for (var pzcl_attr_k in pczl_attrs) {
                    pczl_att[pczl_attrs[pzcl_attr_k].name] = pczl_attrs[pzcl_attr_k].value;
                }
                pczl_att.PCX = [];

                var pcxs = pczls.eq(m).find(".select_option");
                for (var n = 0; n < pcxs.length; n++) {

                    var pcx_attrs = pcxs[n].attributes;
                    var pcx_attr = {};
                    for (var pcx_attr_k in pcx_attrs) {
                        pcx_attr[pcx_attrs[pcx_attr_k].name] = pcx_attrs[pcx_attr_k].value;
                    }
                    if (parseInt(pcx_attr.pcxlx) == 2) {
                        pcx_attr.PCJLBM = pcxs.eq(n).find('input').val();
                        // pcx_attr.PCJLBM = "asdasdadfasdfa";
                        // console.log(pcxs.eq(n).find('input'));
                        // alert("find input text");
                    } else {
                        if (pcxs.eq(n).find('input').is(":checked")) {
                            pcx_attr.PCJLBM = '1';
                        } else {
                            pcx_attr.PCJLBM = '0';
                        }
                    }
                    pczl_att.PCX.push(pcx_attr);
                }

                pcfl.PCX.push(pczl_att);
            }


            aob.PCXFL.push(pcfl);

        }


        d_arr.push(aob);
    }
    return d_arr;
}
